home *** CD-ROM | disk | FTP | other *** search
- Path: blv-pm3-ip24.halcyon.com!user
- From: hawkfish@punchdeck.com (Richard Wesley)
- Newsgroups: comp.lang.c++
- Subject: Re: String Class in native Mac format (ANNOUNCEMENT)
- Date: Thu, 08 Feb 1996 06:58:28 -0800
- Organization: Punch Deck Consulting
- Message-ID: <hawkfish-0802960658280001@blv-pm3-ip24.halcyon.com>
- References: <Pine.SGI.3.91.960206075520.12266D-100000@golgi>
- NNTP-Posting-Host: blv-pm3-ip24.halcyon.com
- X-Newsreader: Yet Another NewsWatcher 2.1.2
-
- In article <Pine.SGI.3.91.960206075520.12266D-100000@golgi>, Joseph Strout
- <jstrout@ucsd.edu> wrote:
-
- >I have a String class whose internal data format is a Str255
- >(255-character Pascal string), the format used by the Macintosh Toolbox.
- >This means that you can pass my String directly to any Toolbox routine
- >which expects a string, either for reading OR writing.
- >
- >This solves what is generally a major headache when using the Toolbox
- >from C/C++, i.e. conversion of various string formats.
- >
- >The class supports all the standard operators ( +, [], ==, etc.) plus a
- >number of other handy operators and functions, such as * (repeat),
- >Element (gets a specified element, separated by a delimiter), Uppercase
- >(obvious), and Plural (pluralizes most English words correctly).
- >
- >Although the internal format is especially handy on the Mac, I use the
- >same class (without modification) on other platforms (including Unix/g++
- >and DOS/Borland C++). The Mac-specific code (mainly the conversion
- >to/from Str255) is separated from the generic code in "#ifdef macintosh"
- >blocks.
- >
- >The code and documentation are available via the WWW at:
- > http://www-ncmir.ucsd.edu/~jstrout/classlib/
- >
- >The class may be used in any product, free of charge -- just slip my name
- >into the credits somewhere, and kindly tell me about it.
-
- I have a template that will do this for any size of Mac string object.
- Not up on a site yet, as it is a part of a larger library still under
- development, but email me if you are interested. Mine is not explicitly
- cross-platform, but allows construction of temporaries loaded from STR#
- resources (a very use type of expression in Mac programming).
-
- Incidentally, PowerPlant comes with a similar template.
-
-
- - rmgw
-
- http://www.punchdeck.com/hawkfish/PunchDeck.html
-
- ----------------------------------------------------------------------------
- Richard Wesley | "I don't know about your dreams
- hawkfish@punchdeck.com | But mine are sort of hackneyed"
- hawkfish@electricfish.com | - Laurie Anderson, "Talk Normal"
- ----------------------------------------------------------------------------
-